{% extends "base.html" %}
{# Page d'inscription #}

{% block content %}
	
	<form class="one-line" action="" method="GET">
        <label class="label-left">Type
			<select name="type" onchange="submit()">        		
				{% for type in types %}
					{%if type.id == typeSelected %}                
						<option selected="selected" value="{{type.id}}">{{type.name}}</option>
					{% else %}
						<option value="{{type.id}}">{{type.name}}</option>
					{% endif %}
				{% endfor %}
			</select>
		</label>
        <label class="label-left">Mode
			<select name="mode" onchange="submit()">
				{% for mode in modes %}
					{%if mode.id == modeSelected %}
						<option selected="selected" value="{{mode.id}}">{{mode.mode}}</option>
					{% else %}
						<option value="{{mode.id}}">{{mode.mode}}</option>
					{% endif %}
				{% endfor %}
			</select>
		</label>
        <label class="label-left">Penta
			<input type="hidden" name="penta" value="off"/>
			<input type="checkbox" name="penta" value="on" {%if pentaSelected == 'on' %}checked="true"{% endif %} onchange="submit()" />
		</label>
		
		{% if countrySelected.getName() %}
			<input type="hidden" name="country" value="{{countrySelected.getId()}}" />
		{% endif %}
    	<input type="hidden" name="begin" value="{{begin}}" />
    	(<strong>{{nbTotalLines}}</strong> players on this ranking.)
		<div class="clearfix-100"></div>
    </form>

	<div class="total-times-ranking-container">
		<div class="pagination-left">
			{%if begin>0 %}
				<a href="{{pagePreviousUrl}}"><img src="{{MEDIA_PATH}}img/icons/{{pagePreviousImg}}" /></a> 
			{% else %}
				<img src="{{MEDIA_PATH}}img/transparent.gif" />
			{% endif %}
		</div>
		<div class="total-times-ranking">
				<div class="ranking_block me">
					<div class="rank">{{myTotalTime.rank}} {{ myTotalTime.country.getFlagHtml()|raw }} </div><div class="nickname">Me: <a href="profile.php?pid={{myTotalTime.pid}}">{{myTotalTime.nickname}}</a></div>
					<pre style="display:inline">{{myTotalTime.total_str}}</pre>
				</div>
			{% for t in totalTimes %}
			{% if not(loop.last and totalTimes|length == nb+1) %}
				<div class="ranking_block">
					<div class="rank">{{ loop.index + begin }} {{ t.country.getFlagHtml()|raw }} </div><div class="nickname"><a href="profile.php?pid={{t.pid}}">{{t.nickname}}</a></div>
					<pre style="display:inline">{{t.total_str}}</pre> <!-- {{t.nbRecords}} -->
				</div>
			{% endif %}
			{% endfor %}
		</div>
		<div class="pagination-right">
			{%if totalTimes|length == nb+1 %}
				<a href="{{pageNextUrl}}"><img src="{{MEDIA_PATH}}img/icons/{{pageNextImg}}" /></a>
			{% else %}
				<img src="{{MEDIA_PATH}}img/transparent.gif" />
			{% endif %}
		</div>
		<div class="clearfix"></div>
		<div class="paginator">{{paginator|raw}}</div>
	</div>
{% endblock content %}